class Solution(object):
    def removeDuplicates(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        count = 1
        # length = len(nums)
        a = nums[0]

        while count <=len(nums)-1:
            if a == nums[count]:
                nums.pop(count)
            else:
                a = nums[count]
                count +=1

        return nums


a = [1,1,2]
s = Solution()
h= s.removeDuplicates(a)
print(h)